import App from './App'
import request from './network/request.js'
import { navTo } from './common/utils.js'
import share from './common/share.js'

// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
Vue.mixin(share)
App.mpType = 'app'
const app = new Vue({
  ...App,share
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
import * as Pinia from 'pinia'

export function createApp() {
  const app = createSSRApp(App)
	app.use(Pinia.createPinia())
	
	app.config.globalProperties.$request = request
	app.config.globalProperties.$navTo = navTo
	app.config.globalProperties.$popupChange = (context, name, type = 'close') => {
	  context.$refs[name][type].apply()
	}
	
  return {
    app
  }
}
// #endif